home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 131 / XENIATGM131.iso / Goodies / I-WAR 2 Egde of Chaos - New SDK / IW2-EOC_Pog_Scripting_SDK.exe / include / CDAudio.h < prev    next >
C/C++ Source or Header  |  2002-01-14  |  4KB  |  193 lines

  1. //
  2. // (c) 1999 Particle Systems Ltd. All Rights Reserved
  3. //
  4. // CDAudio.h
  5. //
  6. // API for the package CDAudio.
  7. //
  8. // Revision control information:
  9. //
  10. // $Header: /flux/packages/CDAudio.h 4     12/06/00 10:55 Derekm $
  11. //
  12.  
  13. #include "Flux.h"
  14.  
  15. #ifdef FLUX_COMPILE
  16.  
  17. FLUX_DECLARE_EXTENSION(CDAudio);
  18.  
  19. #ifdef FLUX_LIB
  20. #if _MSC_VER >= 1000
  21. #pragma comment( lib, "cdaudio" )
  22. #endif // _MSC_VER >= 1000
  23. #endif
  24.  
  25. #else
  26.  
  27. //
  28. // State
  29. //
  30.  
  31. /**
  32.  * Open (as in open file not open CD draw) the CD file system
  33.  *
  34.  * @return TRUE if there is a CD to play
  35.  */
  36. prototype bool CDAudio.Open();
  37.  
  38. /**
  39.  * Determine if the CD is currently playing
  40.  *
  41.  * @return TRUE if the CD is playing
  42.  */
  43. prototype bool CDAudio.IsPlaying();
  44.  
  45. /**
  46.  * Determine if there is a CD to play
  47.  *
  48.  * @return TRUE if there is a CD
  49.  */
  50. prototype bool CDAudio.IsCDAvailable();
  51.  
  52.  
  53. //
  54. // Playing
  55. //
  56.  
  57. /**
  58.  * Play the CD from the beginning, or continue play after a pause
  59.  *
  60.  * @see Pause, Play
  61.  *
  62.  * @return Status
  63.  */
  64. prototype CDAudio.Play();
  65.  
  66. /**
  67.  * Play the given track.
  68.  *
  69.  * @param track The track to play
  70.  */
  71. prototype CDAudio.PlayTrack(int track);
  72.  
  73. /**
  74.  * Play the CD from time start to end.
  75.  *
  76.  * @param start The start time (in seconds)
  77.  * @param end   The end time (in seconds)
  78.  */
  79. prototype CDAudio.PlayStartEnd(float start_time, float end_time);
  80.  
  81. /**
  82.  * Pause the CD. The CD can be restarted through Pause or Play
  83.  */
  84. prototype CDAudio.Pause();
  85.  
  86. /**
  87.  * Stop playing the CD. If Play() is called subsequently then the CD will
  88.  * start at the beginning.
  89.  */
  90. prototype CDAudio.Stop();
  91.  
  92. //
  93. // Position
  94. //
  95.  
  96. /**
  97.  * The currently playing track. Returns S_Fail if no track is currently
  98.  * playing.
  99.  *
  100.  * @return The track number
  101.  */
  102. prototype int CDAudio.CurrentTrack();
  103.  
  104. /**
  105.  * The current position within the CD. This is the time from the
  106.  * beginning of the disk. Returns 0 if the disk is not currently playing.
  107.  *
  108.  * @return The time into the disk
  109.  *
  110.  * @see CurrentTrackPosition
  111.  */
  112. prototype float CDAudio.CurrentPosition();
  113.  
  114. /**
  115.  * The time into the currently playing track.
  116.  *
  117.  * @return The time into the current track
  118.  *
  119.  * @see CurrentPosition, TrackStart, TrackEnd, TrackLength
  120.  */
  121. prototype float CDAudio.CurrentTrackPosition();
  122.  
  123. //
  124. // Volume
  125. //
  126.  
  127. /**
  128.  * Set the current volume for CD output. Volume
  129.  * is defined in the range [0..1]
  130.  *
  131.  * @param left The left volume
  132.  * @param right The right volume
  133.  */
  134. prototype CDAudio.SetVolume( float left,  float right);
  135.  
  136. //
  137. // Disk information
  138. // 
  139.  
  140. /**
  141.  * Returns the number of tracks on the CD.
  142.  *
  143.  * @return The number of tracks 
  144.  */
  145. prototype int CDAudio.NumberOfTracks();
  146.  
  147. /**
  148.  * Return the length (in seconds) of the disk.
  149.  *
  150.  * @return Length of the disk (in seconds). 
  151.  */
  152. prototype float CDAudio.DiskLength();
  153.  
  154. //
  155. // Track information
  156. //
  157.  
  158. /**
  159.  * Return the length (in seconds) of the given track.
  160.  *
  161.  * @param track  The track to query
  162.  *
  163.  * @return The lenth of the track (in seconds)
  164.  *
  165.  * @return status
  166.  */
  167. prototype float CDAudio.TrackLength(int track);
  168.  
  169. /**
  170.  * The time at the start of the given track.
  171.  *
  172.  * @param track The track to query
  173.  *
  174.  * @return  The start time of the track
  175.  *
  176.  * @see TrackLength, TrackEnd
  177.  */
  178. prototype float CDAudio.TrackStart(int track);
  179.  
  180. /**
  181.  * The time at the start of the given track.
  182.  *
  183.  * @param track The track to query
  184.  *
  185.  * @return The end time of the track
  186.  *
  187.  *
  188.  * @see TrackLength, TrackStart
  189.  */
  190. prototype float CDAudio.TrackEnd(int track);
  191.  
  192. #endif // FLUX_LIB
  193.